﻿Imports extranet.BE
Imports extranet.DA

Public Class BCAluno
  Inherits BCUsuario

  Public Shared Function SelecionarAlunosDoCurso(ByVal intIdCurso As Integer) As List(Of BEAluno)
    Dim objDAAluno As New DAAluno()
    Dim objBEAluno As New BEAluno()
    objBEAluno.Cursos = New List(Of BECurso)
    objBEAluno.Cursos.Add(New BECurso(intIdCurso))
    Return objDAAluno.selecionaAlunos(objBEAluno)
  End Function

  Public Shared Function ContarRespostasCertas(ByVal objBEAluno As BEAluno) As Integer
    Dim DAAluno As New DAAluno()
    Return DAAluno.ContarRespostasCertas(objBEAluno)
  End Function

  Public Overloads Shared Function Selecionar(ByVal strAluno As String) As BEAluno
    Dim objBEAluno As New BEAluno
    Dim objDAAluno As New DAAluno
    Dim objDAUsuario As New DAUsuario(booCondicaoSimilar:=False)
    If strAluno IsNot Nothing Then
      Dim objBEUsuarios As New List(Of BEUsuario)
      objBEAluno = DirectCast(objDAUsuario.SelecionaUsuarios(New BEUsuario(strAluno, Nothing))(0), BEAluno)
      LoadDados(objBEAluno)
    End If
    Return objBEAluno
  End Function

End Class